Skip to content

fix: replace deprecated Model.remove with deleteMany - #85

Open
SarthakDudhe wants to merge 1 commit into
WaftTech:masterfrom
SarthakDudhe:fix-deprecated-mongoose-remove
Open

fix: replace deprecated Model.remove with deleteMany#85
SarthakDudhe wants to merge 1 commit into
WaftTech:masterfrom
SarthakDudhe:fix-deprecated-mongoose-remove

Conversation

@SarthakDudhe

Copy link
Copy Markdown

Issue Description
In

bugController.js:L55
, the controller was calling bugSch.remove({}) to delete all error logs. However, Model.remove() is deprecated and was completely removed in Mongoose 8.x (which this project uses: "mongoose": "^8.8.3"). Calling this endpoint would throw a runtime error.

Solution Description
We replaced bugSch.remove({}) with the supported bugSch.deleteMany({}) method, resolving the runtime crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant